package a04_字符串;

/**
 * <p>
 * a01_反转字符串复习4
 * </p>
 *
 * @author flyduck
 * @since 2024/12/30
 */
public class a01_反转字符串复习4 {
    public void reverseString(char[] s) {
        int leftIdx = 0;
        int rightIdx = s.length - 1;
        while (leftIdx < rightIdx) {
            char temp = s[leftIdx];
            s[leftIdx] = s[rightIdx];
            s[rightIdx] = temp;
            leftIdx++;
            rightIdx--;
        }
    }
}
